package pers.jason.wppm.workflow.entity;

import lombok.Data;
import org.activiti.engine.impl.persistence.entity.TaskEntity;
import org.activiti.engine.task.Task;

import java.io.Serializable;
import java.util.Date;

/**
 * @Author: JZH
 * @Date: 2018/11/14 22:50
 * @Description:
 */
@Data
public class TaskResult implements Serializable {

    private static final long serialVersionUID = 1L;

    private String id;

    private String owner;

    private String assignee;

    private String parentTaskId;

    private String name;

    private String description;

    private Date createTime;

    private Date dueDate;

    private String category;

    private String executionId;

    private String processInstanceId;

    private String processDefinitionId;

    private String taskDefinitionKey;

    private String formKey;


    public TaskResult() {
    }

    public TaskResult(Task taskEntity) {
        this.id = taskEntity.getId();
        this.owner = taskEntity.getOwner();
        this.assignee = taskEntity.getAssignee();
        this.parentTaskId = taskEntity.getParentTaskId();
        this.name = taskEntity.getName();
        this.description = taskEntity.getDescription();
        this.createTime = taskEntity.getCreateTime();
        this.dueDate = taskEntity.getDueDate();
        this.category = taskEntity.getCategory();
        this.executionId = taskEntity.getExecutionId();
        this.processInstanceId = taskEntity.getProcessInstanceId();
        this.processDefinitionId = taskEntity.getProcessDefinitionId();
        this.taskDefinitionKey = taskEntity.getTaskDefinitionKey();
        this.formKey = taskEntity.getFormKey();
    }
}
